package com.project.test;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleAdapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/3/21.
 */
public class MyListActivity extends ListActivity{
    private List<Map<String,Object>> list;
    public void innit(){
        list = new ArrayList<Map<String,Object>>();
        Map<String,Object> mp1= new HashMap<String,Object>();
        mp1.put("iv",R.drawable.a1);
        mp1.put("title","lol");
        mp1.put("content","prntapentapentatatatatattta");
        Map<String,Object> mp2= new HashMap<String,Object>();
        mp2.put("iv",R.drawable.a2);
        mp2.put("title","lol2");
        mp2.put("content","rewytwerywrtyweytweywewe");
        Map<String,Object> mp3= new HashMap<String,Object>();
        mp3.put("iv",R.drawable.a3);
        mp3.put("title","lol3");
        mp3.put("content","hreereyertyqeryqeryqerya");
        list.add(mp1);list.add(mp2);list.add(mp3);
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        innit();
        ListAdapter la = new SimpleAdapter(this,list,R.layout.suibian,new String[]{"iv","title","content"}
                ,new int[]{R.id.iv,R.id.title,R.id.content});
        setListAdapter(la);
    }
}
